<script>

import EzApproval from "@/pages/v1/flow/Flowing/comps/EzApproval.vue";
import ViewerSellOrder from "@/pages/v1/erp/SellOrder/js/ViewerSellOrder.vue";
import apiSellOrder from "@/pages/v1/erp/SellOrder/js/apiSellOrder";
export default {
  name: "v1-erp-SellOrder-approval",
  components: {ViewerSellOrder, EzApproval},
  data() {
    return {
      id: 0,
      model:null,
    }
  },
  mounted() {
    this.id = this.$route.query.id*1
    this.getData()
  },
  methods:{
    getData(){
      apiSellOrder.findBy({
        _where: {id: this.id},
        _dumps: ["payType", "contactEmp", "status", "formEmp", "createEmp"],
        page: 1, limit: 1,
      }, res => {
        if (res.length > 0){
          this.model = res[0]
        }
      })
    }
  }
}
</script>

<template>
  <div>
    <EzApproval :owner-id="model.createEmpId" :target-id="id" target-type="erp.SellOrder" v-if="model">
      <ViewerSellOrder :model="{id}"></ViewerSellOrder>
    </EzApproval>
  </div>
</template>

<style scoped>

</style>